package com.itqf.mapper;

import com.itqf.bean.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * projectName: mybatis2103
 *
 * @author: 赵伟风
 * time: 2021/6/25 9:47
 * description:
 */
public interface UserMapper {

    User queryUser(int id);

    @Update("update user set u_name = #{uName},u_age = #{uAge} where u_id = #{uId}")
    int update(User user);

    @Delete("delete from user where u_id = #{id}")
    int delete(int id);

    @Select("select * from user")
    List<User> queryAll();

    @Insert("insert into user (u_name,uage) value(#{uName},#{uAge})")
    int insert(User user);

}
